Skip to content

fix: update dprint-core to 0.75.2 and add code examples to the config schema - #37

Merged
dsherret merged 1 commit into
mainfrom
schema-examples
Nov 6, 2026
Merged

dsherret merged 1 commit into
mainfrom
schema-examples

Conversation

@dsherret

@dsherret dsherret commented Nov 5, 2026

Copy link
Copy Markdown
Member

Updates dprint-core to 0.75.2, which has printer performance fixes and no API changes, and dprint-development to 0.12.1. With 0.12, the spec test callback gets the range to format, which is passed on to format_text_range since the plugin formats ranges (#36).

Documentation in the schema

Improves the configuration documentation that dprint.dev renders from schema.json, like dprint/dprint-plugin-typescript#898 and dprint/dprint-plugin-typescript#899:

  • x-example on indentStyle, quoteStyle, skipMagicTrailingComma, docstringCodeFormat, nestedStringQuoteStyle and preview: input code that's formatted with each of the property's values. The repo's schema.json only has the inputs. The outputs are generated with the built plugin when the schema is published.
  • x-sections at the root: the properties grouped into five sections (General, Strings and commas, Docstrings, Python version and preview, Lint fixes).
  • x-playground at the root: unformatted Python that the dprint.dev playground starts with when this plugin is selected.

No property overrides another, so there's no x-overrides.

Also describes the values of nestedStringQuoteStyle and docstringCodeLineWidth, uses code spans in descriptions, and uses integer with a minimum (and a maximum of 255 for indentWidth and 65535 for lineLength) for the numeric properties.

CI

The new "Generate config schema" step runs the publish-schema task from dprint/automation on the built wasm plugin, before the schema is uploaded to a release. It adds the example outputs, and fails when the plugin has a diagnostic for a property's default, an example formats the same with every value, a top level property isn't in exactly one section, or the playground sample doesn't format or is already formatted.

To see the generated schema locally:

cargo build --target wasm32-unknown-unknown --features wasm --release
cp deployment/schema.json /tmp/schema.json
deno run -A jsr:@dprint/automation@0.14.3/tasks/publish-schema target/wasm32-unknown-unknown/release/dprint_plugin_ruff.wasm /tmp/schema.json --extension py

@dsherret
dsherret merged commit 51b70cd into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant